package com.icloud.common.database.enums;

import lombok.Getter;

@Getter
public enum TFEnum {
    TRUE("TRUE"),
    FALSE("FALSE");

    private final String code;

    TFEnum(String code){
        this.code = code;
    }

    public static TFEnum byCode(String code) {
        for (TFEnum e: TFEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }

    public static boolean isTrue(String code){
        return TRUE.getCode().equals(code);
    }
    public static boolean isFalse(String code){
        return FALSE.getCode().equals(code);
    }
}
